import App from './App'
import request from './utils/request.js'
import Vue from 'vue'
import store from './store'
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import 'dayjs/locale/zh-cn'
dayjs.locale('zh-cn')
dayjs.extend(relativeTime)
Vue.filter('deteFrom',(time,hidden)=>{
	let is=hidden?hidden:false
	var a = dayjs()
	return a.from(time,is)
})
Vue.filter('dateFormat',(time)=>{
	return dayjs(time).format("YYYY-MM-DD")
})
Vue.prototype.dayjs=dayjs()
Vue.config.productionTip = false
Vue.prototype.request=request
////////
var Audio = null
Audio = uni.createInnerAudioContext();
Audio.loop = true;
Audio.onError((res) => {
	var music = uni.getStorageSync('music')
	music.playing=false
	uni.setStorageSync('music',music)
});
Audio.onPause(function() {
	var music = uni.getStorageSync('music')
	music.playing=false
	uni.setStorageSync('music',music)
});
Audio.onPlay(function() {
	var music = uni.getStorageSync('music')
	music.playing=true
	uni.setStorageSync('music',music)
})
Vue.prototype.$Audio=Audio
//////
App.mpType = 'app'
const app = new Vue({
	store,
    ...App
})
app.$mount()